﻿<template>

    <div class="index_bottom_f_m">
        <div class="bottom_bg_cover"></div>
      <!--active-class="index_bottom_active"-->
      <!-- class="index_bottom_btn"-->
      <!-- :class="info.css_name"-->
       <a v-for="(info,index) in menu_list" :to='{path:info.url_name}'
          :key="info.id"
          v-on:click="jump(info.url_name,index)"
          style="position:relative;"
          class="index_bottom_btn"
        >
        <img  v-bind:src="info.sign_c ? info.icon_path : info.icon" class="bot_icon" alt="" :class="info.css_name1">
        <p class="bottom_sty_fs" :class="{bottom_sty_fs_c : info.sign_c  }">{{ info.text }}</p>
      </a>
    </div>

</template>

<script>
  import {mapState, mapMutations, mapActions} from 'vuex';
  import store from '../../vuex/store_index';
  import common from "../../common/common.js"
  import use_rem from "../../../static/js/use_rem.js"
  import { Toast, Indicator,} from 'mint-ui';
  use_rem();
  export default {
    name: 'FooterMenu',
    data () {
      return {
        menu_list: this.$store.getters.get_footer_menu_list,
        sign_c: true,
        user_id:""
      }
    },
    computed: mapState([
      'footer_menu_list'
    ]),
    methods: {
      ...mapActions(['redirect']),
      jump: function (name,index) {

        let id = name.replace("./", "");
        let subpage_style = {
          bottom: '51px'
        };

       let user_id = localStorage.getItem("user_id");
        //没有登陆的
        if(user_id = ""|| user_id ==null || user_id == undefined ){
          Toast({
            message: "请先登陆",
            position: 'bottom',
            duration: 5000
          })
           return;
        }

        //改变底部颜色
        this.$store.commit("change_footer_btn_act",{num:index});

        mui.openWindow({
          url:name+"?user_id="+localStorage.getItem("user_id"),
          id: id,
          createNew: false,//是否重复创建同样id的webview，默认为false:不重复创建，直接显示
          show: {
            autoShow: true,//页面loaded事件发生后自动显示，默认为true
            aniShow: "zoom-fade-in",//页面显示动画，默认为”slide-in-right“；
          },
        })

      }
    },
    mounted: function () {
     let user_id =localStorage.getItem("user_id");
     if(user_id!=""||user_id===null){
       for(let x in obj){
         let name = obj[x].url_name.replace("./","");
         pre_load.push({
           id:name,
           url:name+"?user_id="+user_id
         })
       }
       mui.plusReady(function () {
         mui.init({
           preloadPages:pre_load
         });
       })
       //预加载s
     }
    }
  }
</script>
<!--inner style for thom template-->
<style scoped>
  @import "../../../static/css/FooterMenu.css";
</style>

